<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Layout Example</title>
    <style>
        body, html {
            margin: 0;
            padding: 0;
            height: 100%;
            font-family: Arial, sans-serif;
        }

        .top-bar {
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 25px;
            background-color: steelblue;
            color: white;
            display: flex;
            align-items: center;
            padding: 0 10px;
            box-sizing: border-box;
            z-index: 1000;
        }

        .container {
            display: flex;
            margin-top: 25px; /* Offset for the fixed top bar */
            height: calc(100% - 25px);
            transition: all 0.3s;
        }

        .sidebar {
            width: 250px;
            background-color: #f4f4f4;
            border-right: 1px solid #ccc;
            height: 100%;
            padding: 10px;
            box-sizing: border-box;
            transition: all 0.3s;
        }

        .content {
            flex: 1;
            padding: 10px;
            box-sizing: border-box;
        }

        .tabs {
            display: flex;
            border-bottom: 1px solid #ccc;
        }

        .tab {
            padding: 10px;
            cursor: pointer;
            border: 1px solid #ccc;
            border-bottom: none;
            margin-right: 5px;
        }

        .tab.active {
            background-color: white;
            font-weight: bold;
        }

        .tab-content {
            display: none;
        }

        .tab-content.active {
            display: block;
        }

        .hide-sidebar .sidebar {
            display: none;
        }

        .hide-sidebar .content {
            margin-left: 0;
        }
    </style>
</head>
<body>
    <div class="top-bar">
        <button onclick="toggleSidebar()">Toggle Sidebar</button>
        <span style="margin-left: 10px;">This is the top bar</span>
    </div>
    <div class="container" id="main-container">
        <div class="sidebar" id="sidebar">
            <p>Sidebar content here</p>
        </div>
        <div class="content">
            <div class="tabs">
                <div class="tab active" onclick="openTab(event, 'tab1')">Tab 1</div>
                <div class="tab" onclick="openTab(event, 'tab2')">Tab 2</div>
                <div class="tab" onclick="openTab(event, 'tab3')">Tab 3</div>
            </div>
            <div id="tab1" class="tab-content active">
                <p>Content for Tab 1</p>
            </div>
            <div id="tab2" class="tab-content">
                <p>Content for Tab 2</p>
            </div>
            <div id="tab3" class="tab-content">
                <p>Content for Tab 3</p>
            </div>
        </div>
    </div>

    <script>
        function toggleSidebar() {
            var container = document.getElementById('main-container');
            container.classList.toggle('hide-sidebar');
        }

        function openTab(event, tabId) {
            var i, tabcontent, tablinks;
            tabcontent = document.getElementsByClassName("tab-content");
            for (i = 0; i < tabcontent.length; i++) {
                tabcontent[i].style.display = "none";
            }
            tablinks = document.getElementsByClassName("tab");
            for (i = 0; i < tablinks.length; i++) {
                tablinks[i].className = tablinks[i].className.replace(" active", "");
            }
            document.getElementById(tabId).style.display = "block";
            event.currentTarget.className += " active";
        }
    </script>
</body>
</html>
